'use strict';

var fs = require("fs");

module.exports = function (app) {

    app.post('/api/function', function (req, res) {
        fs.readFile("datas/result.json", function (error, fileData) {
            if (error) {
                console.log('read err : ' + error);
            }

            var data;
            for (var key in req.body) {
                if(key == 'pci_SetOOBFWSlots') {
                    for(var i = 0;i < 50000;i++) {
                        console.log('test')
                    }
                }

                data = JSON.parse(fileData)[key];
            }
            res.json(data);

        });

    });

};